/*
 * @Description: 元数据管理
 * @Author: Rfan
 * @Date: 2022-01-07 09:15:48
 * @LastEditTime: 2022-12-30 15:07:50
 */

import classNames from 'classnames/bind';
import { MetadataBusinessContextProvider } from './contexts/MetadataBusinessContext';
import { MetadataBusRouterTypeContext } from './contexts/MetadataBusRouterTypeContext';
import PageLayout from '@/layout/PageLayout';
import NavSidebar from './components/NavSidebar';
import List from './components/List';
import { EnumMetadataBusRouteTypes } from './dictionaries';
import styles from './styles/metadataMain.module.scss';

const cx = classNames.bind(styles);

interface ISystemMetadataProps {
  routerType?: EnumMetadataBusRouteTypes;
}

export const SystemMetadataBusinessPage = (props: ISystemMetadataProps) => {
  const { routerType = EnumMetadataBusRouteTypes.Normal } = props;

  return (
    <>
      <MetadataBusRouterTypeContext.Provider value={{ routerType }}>
        <MetadataBusinessContextProvider>
          <PageLayout className={cx('metadata-wrap')} sidebar={<NavSidebar />}>
            <List />
          </PageLayout>
        </MetadataBusinessContextProvider>
      </MetadataBusRouterTypeContext.Provider>
    </>
  );
};

const SystemMetadataBusiness = () => <SystemMetadataBusinessPage />;

export default SystemMetadataBusiness;
